import { useEditor } from '@craftjs/core';
import React from 'react';

export const SettingPane = () => {
  const { selected } = useEditor((state) => {
    const [currentNodeId] = state.events.selected;
    return { selected: state.nodes[currentNodeId] };
  });

  if (selected?.related?.settings) {
    // const SettingsComponent = selected.related.settings;
    // return <SettingsComponent />;

    return React.createElement(selected.related.settings);
  }
  return <></>;
};
